package smn.dao.manager;

import java.util.Collection;
import java.util.List;

/**

 * User: Abdulaziz
 * Date: 1/8/12
 * Time: 10:11 AM
 */
public interface IJpaTemplate<T> {
    public T findById(long id);

    public T findById(int id);

    public List<T> findAll();
    public List<T> findAll(boolean isAcs);


    public T update(T t);

    public void update(Collection<T> list);

    public T delete(T t);

    public void delete(Collection<T> list);

    public int count();

    public T merge(T t);

    public void merge(Collection<T> list);

    public void persist(Collection<T> list);

    public T persist(T t);

    public List<T> list(final String query, final int startIndex, final int maxResult);
    public List<T> list(final String query);

    public T getSingleResult(final String query);
}
